package com.woniuxy.controller;

import com.woniuxy.entity.Video;
import com.woniuxy.service.VideoService;
import com.woniuxy.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController //所有数据默认以json返回 @ Controller+responsebody
@RequestMapping("/video")//指定访问路径
public class VideoController {

    @Autowired
    private VideoService videoService;

    @RequestMapping("/findByJid")
    public Result<List<Video>> findByJid(int jid) {
        Result<List<Video>> result = new Result<>();
        result.setStatus(Result.SUCCESS);
        result.setData(videoService.findByJid(jid));

        return result;

    }

}
